#include <iostream>
#include <QCoreApplication>

#include "Matrix.h"
#include "Quaternion.h"

int main(int argc, char *argv[])
{
    QCoreApplication a(argc, argv);

    Matrix4 mat;

    float angle=3.14f/2.0f;

    mat.Print();


    Matrix4 rot, rot2, rot3;
    rot =   ((Quaternion::Euler(0, angle,0)).RotationMatrix());
    rot2=((Quaternion::Euler(0, angle,0)).RotationMatrix());
    rot3=((Quaternion::Euler(0, angle,0)).RotationMatrix());

    rot = rot*rot2;
   // rot = rot*rot3;

   // Matrix4 tot = mat*rot;


   // Matrix4 lol;
   // lol=mat.Translation(1,1,1);
    vec4  vec = rot*vec4::Forward;

    vec4 test = vec4::TurnAround(3.140f/2.0f,3.140f/2.0f,1.0f,vec4::Zero);

    printf("Print vector \n");
    vec.Print();

    printf("Turn Around \n");
    test.Print();


    vec4    target  =   vec4(0.0,5.0,10.0f)-vec4::Zero;

    vec4 axis    =   vec4::Cross(vec4::Forward, target);

    float dot   =vec4::Dot(target.Normalize(),vec4::Forward);
    float value = acos(vec4::Dot(target,vec4::Forward));

    mat    =   Quaternion(axis.x, axis.y, axis.z, 0.1).RotationMatrix();

    printf("Quaternion : \n");
    mat.Print();
    return a.exec();

}
